			<?php $do_action 	= $this->session->userdata('do_action_success'); 
				  $change_status= $this->session->userdata('change_status_success');		
				if(isset($do_action) && $do_action == "yes"){?>
				<div id="tonySuccess" class="success"><?php echo $this->lang->line('action_mess');?></div>
			<?php }elseif (isset($change_status) && $change_status == "yes") {?>
				<div id="alertMessage" class="success"><?php echo "Status has been changed successfully !";?></div>
			<?php }?>
			<div id="content">
                <div class="inner">
					  <div class="topcolumn">
							<div class="logo"></div>
                            <ul  id="shortcut">
                                <li> <a href="#" title="Back To home"> <img src="<?php echo base_url();?>public/admin/img/icon/shortcut/home.png" alt="home"/><strong>Home</strong> </a> </li>
                                <li> <a href="#" title="Website Graph"> <img src="<?php echo base_url();?>public/admin/img/icon/shortcut/graph.png" alt="graph"/><strong>Graph</strong> </a> </li>
                                <li> <a href="#" title="Setting" > <img src="<?php echo base_url();?>public/admin/img/icon/shortcut/setting.png" alt="setting" /><strong>Setting</strong></a> </li> 
                                <li> <a href="#" title="Messages"> <img src="<?php echo base_url();?>public/admin/img/icon/shortcut/mail.png" alt="messages" /><strong>Message</strong></a><div class="notification" >10</div></li>
                            </ul>
                            
					  </div>
	                  <div class="clear"></div>

	                  <div class="onecolumn" >
	                  	  <div class="header"><span ><span class="ico  gray arrow_bidirectional"></span><?php echo $this->lang->line('adminstrator');?></span> </div><!-- End header -->	
	                  	  <div class="clear"></div>
		                  <div class="content" >
		                      <div id="uploadTab">
			                      <div class="toppage" >
			                      	  
			                      	  <span class="left">
			                      	  	
							        	<select style="width: 130px;" id="action" name="action">
							            	<option value=""><?php echo $this->lang->line('choose_action'); ?></option>
							            	<?php $account_info = $this->session->userdata('user');
			                      	  			if($account_info['group'] == "admin"){
			                      	  		?>                               
							                <option value="active"><?php echo $this->lang->line('active'); ?></option>
							                <option value="suspend"><?php echo $this->lang->line('suspend'); ?></option>
							                <option value="delete"><?php echo $this->lang->line('delete'); ?></option>
							                <?php }?>
							            </select>
							            <input onclick="submit_action()" value="<?php echo $this->lang->line('apply'); ?>" class="btn" type="button" />
							          </span>
			                      </div>
			                      <div class="tab_container" >
			                          <div id="tab" class="tab_content"> 
			                            <div class="load_page">
			                              <?php if($account_info['group'] == "admin"){?>
			                              <ul class="uibutton-group">
			                                    <li><a class="uibutton icon add " href="<?php echo admin_url(); ?>/add-new-adminstrator" title="<?php echo $this->lang->line('add'); ?>"><?php echo $this->lang->line('add'); ?></a></li>
			                              </ul>
			                              <?php }?>
			                              <div class="topart">
			                              	<form action="<?php echo admin_url();?>/adminstrators-management" method="post" id="list_adminstrators_form">
				                              	<span class="left">
										    		<?php $total_amount	=	$this->adminstrators_model->count_all();
										    			  $active		=	$this->adminstrators_model->count_active();		
										    		?>
										    		<font class="number">(<?php echo $total_amount;?>)</font>
										    		<a href="javascript:void(0);" onclick="sendData('all')"><?php echo $this->lang->line('all'); ?></a>
										    		<font class="line">|</font><font class="number">(<?php echo $active;?>)</font>
										    		<a href="javascript:void(0);" onclick="sendData('active')"><font color="#0b9901"><?php echo $this->lang->line('active'); ?></font></a>
										    		<font class="line">|</font><font class="number">(<?php $inactive = $total_amount - $active; echo $inactive;?>)</font>
										    		<a href="javascript:void(0);" onclick="sendData('pending')"><font color="#c60001"><?php echo $this->lang->line('pending'); ?></font></a>
										        </span>
										        <span class="right1">
										        	<select style="width:50px;" name="perpage" id="perpage" onchange="changeItemNumber()">
										            	<option value="6" <?php echo ($current_perpage==6)?'selected':'';?>>6</option>
										                <option value="12" <?php echo ($current_perpage==12)?'selected':'';?>>12</option>
										                <option value="24" <?php echo ($current_perpage==24)?'selected':'';?>>24</option>
										                <option value="all" <?php echo ($current_perpage=='all')?'selected':'';?>><?php echo $this->lang->line('all'); ?></option>
										            </select>
									        	</span>
								        	</form>
			                              </div>
			                              <form action="<?php echo admin_url();?>/adminstrator/do-action" method="post" id="action_form">
											  <div class="tableName toolbar">
												<table class="display data_table2" >
													<thead>
														<tr>
															<th width="5%" ><input type="checkbox" class="check_all" onclick="check_all('.check_all')"/></th>
						                                    <th width="17%" align="left">Username</th>
						                                    <th width="15%" align="left">Fullname</th>
						                                    <th width="25%" align="left">Email</th>
						                                    <th width="15%" align="left">Group</th>
						                                    <th width="15%" align="left">Created Date</th>
						                                    <th width="7%" align="left">Status</th>
														</tr>
													</thead>
													<?php if(count($accs_list[0])>0) {?>
	        										<?php foreach ($accs_list as $k => $v){?>
													<tr>
														<?php if($v->username == $account_info['username'] || $v->group == "admin"){?>
				                                    		<td align="left"></td>
				                                    	<?php }else{?>
				                                    		<td  align="left" >
				                                    		<input name="id[]" value="<?php echo $v->id;?>" type="checkbox" />
				                                    		</td>
				                                    	<?php }?>
				                                    	
					                                    <td  align="left" >
					                                    	<?php if($account_info['group'] == "admin"){?>
					                                    	<div class="column"  onmouseover="Hovercat('<?php echo $v->id;?>')" onmouseout="Outcat('<?php echo $v->id;?>')">
					                                    		<a href="javascript;" class="art admin_<?php echo $v->id;?>"><?php echo $v->username;?></a>
					                                    		<div class="action" id="neocat-<?php echo $v->id;?>">
												                    <img src="<?php echo base_url();?>public/admin/img/edit.gif" /><a href="<?php echo admin_url(); ?>/edit-adminstrator/<?php echo $v->id;?>"><?php echo $this->lang->line('edit'); ?></a>
												                    <?php if($v->username != $account_info['username']){?> 
												                    | <img src="<?php echo base_url();?>public/admin/img/delete.gif" /><a href="#" onclick="Remove('<?php echo admin_url();?>/delete-adminstrator/<?php echo $v->id;?>', '<?php echo $v->username;?>')" class="Delete"><font color="#be0000"><?php echo $this->lang->line('delete'); ?></font></a>
												                    <?php }?>
												                </div>
					                                    	</div>
					                                    	<?php }elseif ($v->username == $account_info['username']){?>
					                                    		<div class="column"  onmouseover="Hovercat('<?php echo $v->id;?>')" onmouseout="Outcat('<?php echo $v->id;?>')">
					                                    		<a href="javascript;" class="art admin_<?php echo $v->id;?>"><?php echo $v->username;?></a>
					                                    		<div class="action" id="neocat-<?php echo $v->id;?>">
												                    <img src="<?php echo base_url();?>public/admin/img/edit.gif" /><a href="<?php echo admin_url(); ?>/edit-adminstrator/<?php echo $v->id;?>"><?php echo $this->lang->line('edit'); ?></a>
												                </div>
					                                    	</div>
					                                    	<?php }else{?>
					                                    		<a href="">Only admin can see this</a>
					                                    	<?php }?>
					                                    </td>
					                                    <td align="left"><?php echo $v->fullname;?></td>
					                                    <?php if($account_info['group'] == "admin" || $v->group == $account_info['group']){?>
					                                    	<td align="left" style="color:green;"><?php echo $v->email;?></td>
					                                    <?php }else{?>
					                                    	<td align="left" style="color:green;">Only admin can see this</td>
					                                    <?php }?>
					                                    <?php if($account_info['group'] == "admin" || $v->group == $account_info['group']){?>
					                                    	<td align="left"><?php echo $v->group;?></td>
					                                    <?php }else {?>
					                                    	<td align="left">None</td>
					                                    <?php }?>
					                                    <td align="left"><?php echo $v->time;?></td>
				                                        <td align="left">
				                                        	<?php if($v->active != 'no'){?>
											            		<?php 
											            		    if($v->username == $account_info['username'] || $v->group == "admin" || $account_info['group'] != "admin"){?>
											            				<img src="<?php echo base_url();?>public/admin/img/active.png" title="<?php echo "Can not deactivate this account"; ?>" alt="Yes" class="icon png" />
											            		<?php }else{?>
											            			<a href="javascript:void(0);" onclick="__status('<?php echo $v->id; ?>', 'no', 'adminstrator/change-status/', '<?php echo $current_url;?>')"><img src="<?php echo base_url();?>public/admin/img/active.png" title="<?php echo $this->lang->line('active'); ?>" alt="Yes" class="icon png" /></a>
											            		<?php }?>
											            	<?php }else {?>
											            		<?php 
											            		    if($v->username == $account_info['username'] || $v->group == "admin" || $account_info['group'] != "admin"){?>
											            				<img src="<?php echo base_url();?>public/admin/img/pending.png" title="<?php echo "Can not activate this account"; ?>" alt="Yes" class="icon png" />
											            		<?php }else{?>
											            			<a href="javascript:void(0);" onclick="__status('<?php echo $v->id; ?>', 'yes', 'adminstrator/change-status/', '<?php echo $current_url;?>')"><img src="<?php echo base_url();?>public/admin/img/pending.png" title="<?php echo $this->lang->line('suspend'); ?>" alt="No" class="icon png" /></a>
											            		<?php }?>
											            	<?php }?>
				                                        </td>
				                                  	</tr>
				                                  	<?php }}else{?>
				                                  		<p style="font-style: italic; color: green; font-size: 14px;">There are no contents this moments !</p>
				                                  	<?php }?>
											  	  </table>
											  </div>
											  <span class="right1">
									                <div class="pagination">
									                	<?php if(isset($pagination)){echo $pagination;}?>
									            	</div>
								              </span>
			                              </form>
			                              </div>
			                          </div><!--tab2-->
			                  	  </div>
		                  	  </div><!--/END TAB/-->
		                  <div class="clear"/></div>  
		                  </div>
	                  </div>
                  <div class="clear"></div>
                  <script type="text/javascript" src="<?php echo base_url();?>public/admin/js/login.js"></script>
                  <script type="text/javascript">
                  	var do_action_success 		= '<?php echo $this->session->userdata('do_action_success');?>';
                  	var do_action_mess			= '<?php echo $this->lang->line('action_mess');?>';
                  	if(do_action_success == "yes"){$('#tonySuccess').addClass('success').html(do_action_mess).stop(true,true).show().animate({ opacity: 1,right: '10'}, 1000);setTimeout('hideTop()',3500);<?php $this->session->unset_userdata('do_action_success');?>}

					var change_status_success 	= '<?php echo $this->session->userdata('change_status_success');?>';
                  	var change_status_mess		= 'Status has been changed successfully !';
					if(change_status_success == "yes"){$('#alertMessage').addClass('success').html(change_status_mess).stop(true,true).show().animate({ opacity: 1,right: '10'}, 1000);setTimeout('hideTop()',3500);<?php $this->session->unset_userdata('change_status_success');?>}

					function changeItemNumber() {
						$("#list_adminstrators_form").submit();
					}
				
					function sendData(stat){
						var status = stat;
						$('input[name="status"]').val(status);
						$('#show_type').submit();
					}

					function submit_action(){
						submitVal = $('#action').val();
					     $('#action_form').append("<input type='hidden' name='action' value='"+submitVal+"' />");
					     $('#action_form').submit();
					     return true;
					}
					
					jQuery(document).ready(function(){
						jQuery("#edit-adminstrator-form").validationEngine();
					});
				

					function Remove(url, name){
						$(".Delete").live('click',function() {
							  var row=$(this).parents('tr');
							  var dataSet=$(this).parents('form');
							  var id = $(this).attr("id");
							  var data ='id='+id;
							  DeleteT(data,name,row,0,dataSet, url);
						});
					}

					function DeleteT(data,name,row,type,dataSet, url){
						var loadpage = dataSet.hdata(0);
						
						var table = dataSet.hdata(2);
						var data = data+"&tabel="+table;
						$.confirm({
						'title': '_DELETE DIALOG BOX','message': " <strong><?php echo $this->lang->line('delete_conf') ?></strong><br /><font color=red>' "+ name +" ' </font> ",'buttons': {'Yes': {'class': 'special',
						'action': function(){
							loading('Checking');
											 $('#preloader').html('Deleting...');
											 if(type==0){ row.slideUp(function(){   showSuccessTony('Delete Successfully',1000); unloading(); }); $.post(url);return true;}
											 if(type==1){ row.slideUp(function(){   showSuccess('Success',2000); unloading(); }); return true;}
												setTimeout("unloading();",900); 		 
								 }},'No'	: {'class'	: ''}}});}
				</script>
				<?php 
					echo form_open(admin_url('adminstrators-management'), array('id' => 'show_type'), array('status' => 0));
					echo form_close();
				?>